﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using HolySword.Delegates;
using Styx.TreeSharp;
using Styx.WoWInternals.WoWObjects;
using Styx;

namespace HolySword.Behaviours
{
    class Get
    {
        private static LocalPlayer Me = HolySword.Me;

        public static Composite Do(string type)
        {
            return Do(type, ret => Me.IsAlive, ret => Me);
        }
        public static Composite Do(string type, SimpleBooleanDelegate condition)
        {
            return Do(type, condition, ret => Me);
        }
        public static Composite Do(string type, SimpleBooleanDelegate condition, UnitSelectionDelegate target)
        {
            switch (type)
            {
                case "Resting":
                    switch (Me.Specialization)
                    {
                        case WoWSpec.PaladinHoly:
                            return Behaviours.Resting.DoHoly();
                        case WoWSpec.PaladinProtection:
                            return Behaviours.Resting.DoProtection();
                        case WoWSpec.PaladinRetribution:
                            return Behaviours.Resting.DoRetribution();
                        default:
                            return Behaviours.Resting.DoRetribution();
                    }
                case "Pull":
                    switch (Me.Specialization)
                    {
                        case WoWSpec.PaladinHoly:
                            return Behaviours.Pull.DoHoly(target, condition);
                        case WoWSpec.PaladinProtection:
                            return Behaviours.Pull.DoProtection(target, condition);
                        case WoWSpec.PaladinRetribution:
                            return Behaviours.Pull.DoRetribution(target, condition);
                        default:
                            return Behaviours.Pull.DoRetribution(target, condition);
                    }
                case "PreCombat":
                    switch (Me.Specialization)
                    {
                        case WoWSpec.PaladinHoly:
                            return Behaviours.PreCombat.DoHoly(condition);
                        case WoWSpec.PaladinProtection:
                            return Behaviours.PreCombat.DoProtection(condition);
                        case WoWSpec.PaladinRetribution:
                            return Behaviours.PreCombat.DoRetribution(condition);
                        default:
                            return Behaviours.PreCombat.DoRetribution(condition);
                    }
                case "Combat":
                    switch (Me.Specialization)
                    {
                        case WoWSpec.PaladinHoly:
                            return Behaviours.Combat.DoHoly();
                        case WoWSpec.PaladinProtection:
                            return Behaviours.Combat.DoProtection();
                        case WoWSpec.PaladinRetribution:
                            return Behaviours.Combat.DoRetribution();
                        default:
                            return Behaviours.Combat.DoRetribution();
                    }
                default:
                    return Behaviours.PreCombat.DoHoly(condition);
            }
        }
    }
}
